# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-slowapi
_pkgname=slowapi
pkgver=0.1.9
pkgrel=3
pkgdesc='A rate limiting extension for Starlette and Fastapi.'
arch=('any')
url='https://pypi.org/project/slowapi/#files'
license=('MIT')
depends=('python' 'python-limits' 'python-redis')
makedepends=('python-build' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('9d3f868a4121e5aff4dc79d2820ca4114019ba7b7cb73f379885529d611a637cc53ac7bdfc7716284c008a54d6ef6dabf907a09ae1ddfc09194569ed54d3e90b')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

	pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

